﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcIocDemo.Services;
using Summer.Web.Mvc;

namespace MvcIocDemo.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public RandomNumberMakerService Number { get; set; }
        
        public ActionResult Index()
        {
            var a = (RandomNumberMakerService)this.GetDefaultContextObject("random");
            var b = a.Make();
            ViewData["Message"] = "Welcome to ASP.NET MVC! "+b;
            ViewData["Service"] =  "The Service Return " + Number.Make();
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
